SetBackendServers
Description
call SetBackendServers to set back-end server weights.
Request Method
POST
Request Path
/apsara/route/Slb/SetBackendServers
Request Parameters Common Parameters
| Name | Location | Type | Required | Sample value | Description |
|---|---|---|---|---|---|
| regionId | BODY | string | Yes | No sample value for this parameter. | region id |
| LoadBalancerId | BODY | string | Yes | lb-bp1qjwo61pqz3a**** | load balancing instance ID. |
| BackendServers | BODY | string | Yes | [{ "ServerId": "i-xxxxxxxxx", "Weight": "100", "Type": "ecs", "Port":"80","Description":"test-112" }] | list of back-end servers to be added. Value: is a Json string, and its structure is a JsonList. In a request, the list supports up to 20 elements. ServerId:String type, required, instance ID of the backend server. Port:Integer type, required, port used by backend server, value range:1~65535. Weight:Integer type, required, weight of backend server, value range:0~100. Description :String type, optional, backend server description, length 1-80 characters, allow letters, numbers, dashes (-), forward slashes (/), half-width periods (.), and underscores (_). Chinese is supported. Type:String type, indicating the instance type of the backend server, value: ecs(default): ECS instance. eni: ENI instance. ServerIp: the instance IP of ECS or ENI. The example is as follows: example of mounting ECS:[{ "ServerId": "i-xxxxxxxxx", "Weight": "100", "Type": "ecs", "Port": "80", "Description": "test-112" }] mount ENI:[{ "ServerId": "eni-xxxxxxxxx", "Weight": "100", "Type": "eni", "ServerIp": "192.168.**.**", "Port": "80", "Description": "test-112" }] mount ENI multi-IP:[{ "ServerId": "eni-xxxxxxxxx", "Weight": "100", "Type": "eni", "ServerIp": "192.168.**.**", "Port": "80", "Description": "test-112" },{ "ServerId": "eni-xxxxxxxxx", "Weight": "100", "Type": "eni", "ServerIp": "172.166.**.**", "Port": "80", "Description": "test-113" }] description must be a running backend server instance to join the load balancing instance, and a maximum of 20 backend servers can be added for each call. at the same time, only guaranteed-performance instances can add eni backend servers. |
| version | BODY | string | No | 2016-01-01 | version of api |
Return data
| Name | Type | Sample value | Description |
|---|---|---|---|
| Type | string | ecs | backend server type, value: ecs(default):ECS instance. eni: ENI instance. |
| ServerId | string | eni-hg231**** | ECS instance ID. |
| Description | string | backend server | backend server description. |
| RequestId | string | 365F4154-92F6-4AE4-92F8-7FF34B540710 | request ID. |
| BackendServer | No sample value for this parameter. | No description for this parameter. | |
| LoadBalancerId | string | lb-bp1qjwo61pqz3a**** | load balancing instance ID. |
| BackendServers | array of backendserver | No sample value for this parameter. | backend server list. |
| Weight | string | 100 | the weight of the back-end server. |
Example
Successful Response example
{
"Type":"ecs",
"ServerId":"eni-hg231****",
"Description":"backend server",
"RequestId":"365F4154-92F6-4AE4-92F8-7FF34B540710",
"BackendServer":"",
"LoadBalancerId":"lb-bp1qjwo61pqz3a****",
"BackendServers":"",
"Weight":"100"
}
Failed Response example
{
"errorSample":
{
"resultCode":-1,
"resultMsg":"system error",
"result":null
}
}